package com.mall.user.domain.model;

public record GoodsName(String name) {
    public GoodsName {
        //商品名称为3到50个字符
        if (name.length() < 3 || name.length() > 50) {
            throw new IllegalArgumentException("商品名称长度必须在3到50个字符之间");
        }
    }

    public static GoodsName of(String name) {
        return new GoodsName(name);
    }
}
